package wyu.controller;

import org.springframework.web.bind.annotation.*;
import wyu.service.CategoryBarService;

import javax.annotation.Resource;

@RestController
@RequestMapping("/category_bar")
public class CategoryBarController {
    @Resource
    CategoryBarService categoryBarService;
    @GetMapping("/getCategory")
    public int getCategory(@RequestParam("barId")int barId){
        return categoryBarService.getCategory(barId);
    }
    @PostMapping("/addRelevancy")
    public boolean addRelevancy(@RequestParam("barId")int barId,
                                @RequestParam("categoryId")int categoryId){
        return categoryBarService.addRelevancy(barId,categoryId);
    }
}
